<#include "layout/template.ftl"/>

<@htmlHead title="平台订单详情">

	<style>
		tr td:first-child,tr th:first-child{
			text-align:center;
		}
	</style>
	
</@htmlHead>


 
<@htmlBody 'order' 'orderPlat'>

	<!-- breadcrumbs begin -->
	<#include "layout/breadcrumbs.ftl">
	<@breadcrumbs '平台订单管理' '平台订单详情'></@breadcrumbs>
	<!-- breadcrumbs end -->

	<!-- page-content begin -->
	<div class="page-content">
			
			<!-- page-header begin -->
			<div class="page-header">
					<h1>平台订单详情</h1>
			</div>
			<!-- page-header end -->

			<!-- page-body begin -->
			<div class="row">	
				<div class="col-md-8 col-md-offset-2">

							<fieldset>
							<!-- -----------------------------------我是分割线---------------------------------------- -->
								
								<h6>订单信息</h6>
					       		<div>
					       			<table class="table">
					       				<tr>	
											<th width="100">订单编号</th>
											<th>订单总金额</th>
											<th>减免总金额</th>
											<th>支付总金额</th>
											<th>支付方式</th>
											<th>收货方式</th>
											<th>支付类型</th>
											<th>创建时间</th>
										</tr>
						       			
										<tr>	
											<td>${orderPlat.orderno}</td>
											<td>${orderPlat.actualPrice}</td>
											<td>${orderPlat.subPrice}</td>
											<td>${orderPlat.total}</td>
											<td>
												<#if orderPlat.paymentType==1>	
												     支付宝
												<#else>	
												     微信支付
												</#if>
											</td>
											<td>
												<#if orderPlat.consigneeType==1>	
												     快递
												<#else>	
												     自提
												</#if>
											</td>
											<td>
												<#if orderPlat.paymode==1>	
												     现金
												<#else>	
												     积分
												</#if>
											</td>
											<td>${orderPlat.createTime}</td>
										</tr>
										
									</table>
								</div>
								<!-- -----------------------------------我是分割线---------------------------------------- -->
								
								<div class="hr hr-dotted"></div>
								<h6>子订单信息</h6>
								
								<#list ordermaps as ordermap>
								<div>
									<table class="table table-bordered">
					       				<tr>	
											<td width="100">订单编号</td>
											<td>${ordermap.order.orderno}</td>
										</tr>
										<tr>	
											<td>所属商户</td>
											<td>
												${ordermap.order.merchant.name}
											</td>
										</tr>
										
										<#list ordermap.orderItems as item>
											<tr>	
												<td>购买商品</td>
												<td>
													${item.goods.name}&nbsp;&nbsp;&nbsp;x&nbsp;${item.amount}&nbsp;&nbsp;单价:&nbsp;&nbsp;${item.price}元                                       
												</td>
											</tr>
										
										</#list>
										
										<tr>	
											<td>快递</td>
											<td>
												${ordermap.order.express.name}
											</td>
										</tr>	
										<tr>	
											<td>快递单号</td>
											<td>
												${ordermap.order.expressno}
											</td>
										</tr>
										<tr>	
											<td>优惠券</td>
											<td>
												${ordermap.order.voucher.name}
											</td>
											
										</tr>
										<tr>	
											<td>实际总金额</td>
											<td>
												${ordermap.order.actualPrice}
											</td>
											
										</tr>
										<tr>	
											<td>实际支付金额</td>
											<td>
												${ordermap.order.total}
											</td>
										</tr>
										<tr>	
											<td>减免总金额</td>
											<td>
												${ordermap.order.subPrice}
											</td>
											
										</tr>
										<tr>	
											<td>订单状态</td>
											<td>
												<#list OrderStatusEnum as em>
												<#if ordermap.order.status==em.value>	
													${em.comment}
												</#if>
												</#list>
											</td>
										</tr>
									</table>
								</div>
								<div class="hr hr-dotted"></div>
								</#list>
							<!-- -----------------------------------我是分割线---------------------------------------- -->	
								
															
							</fieldset>
								<!-- 表单开始 -->
						<form class="form-horizontal" id="validation-form" method="post" action="${path}/manage/order/orderPlat/remarks" >
								<input type="hidden" id="id" name="id"  value="${orderPlat.id}">
								<span> 备注  </span>
								 <input type="text" class="form-control" placeholder="请输入备注" name="remarks" id="remarks" value="${orderPlat.remarks}"  style="margin-top: 10px;">
					            <button id="form-submit" type="submit" class="btn btn-primary" style="margin-top: 10px;">
									<i class="fa fa-save align-top bigger-125"></i>保存
								</button>
						</form>	 
			</div>
			<!-- page-body end -->
		
	</div>		
	<!-- page-content end -->

</@htmlBody>



<@htmlBodyScript>
    
	<!-- 验证框架 -->	
	<script src="${resources}/plugins/jquery-validation/jquery.validate.min.js"></script>
	<script src="${resources}/plugins/jquery-validation/messages_zh.min.js"></script>
	<script type="text/javascript">

			jQuery.validator.addMethod("isName", function(value, element) {       
	 			var corpName =  /^[\u0391-\uFFE5\w\-\s\.]{1,50}$/;
  				 return this.optional(element) || corpName.test(value);       
 			}, "请使用汉字、英文字母、数字、下划线、减号、空格或点");   
 			
	
			$('#validation-form').validate({
				errorElement: 'div',
				errorClass: 'help-block',
				focusInvalid: false,
				rules: {
					name: {
						required:true,
						maxlength: 50,
						isName:true
					},
					title: {
						required:true,
						maxlength: 100
					},
					price: {
						required:true
					},
					total: {
						required:true,
						range:[1,1000000]
					},
					remain: {
						required:true,
						range:[1,1000000]
					},
					paytype: {
						required:true
					},
					cagList: {
						required:true
					},
					"classify.id": {
						required:true
					},
					remark: {
						maxlength: 255
					}
				},
		
				messages: {
				},
		
		
				highlight: function (e) {
					$(e).closest('.form-group').removeClass('has-info').addClass('has-error');
				},
		
				success: function (e) {
					$(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
					$(e).remove();
				},
		
				errorPlacement: function (error, element) {
					if(element.is('input[type=checkbox]') || element.is('input[type=radio]')) {
						var controls = element.closest('div[class*="col-"]');
						if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
						else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));
					}
					else if(element.is('.select2')) {
						error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));
					}
					else if(element.is('.chosen-select')) {
						error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));
					}
					else error.insertAfter(element.parent());
				},
		
				submitHandler: function (form) {
					form.submit();
				},
				invalidHandler: function (form) {
				}
			});
	</script>
</@htmlBodyScript>